const express = require("express")
const app = express()
const cors = require("cors")
const register = require("./routers/register")

const bodyparser = require('body-parser')
const port = 3000
// 跨域共享资源
app.use(cors())
app.use(bodyparser.json())
app.use(bodyparser.urlencoded({ extended: true }))

// 数据库引用图片拼接
app.use(express.static('../jdxm/src/assets/detalis'))

// 引用数据库里面的detalis表
app.use('/api',require('./api/details'))

app.use('/admin',require('./routers/login'))
app.use('/admin',require('./routers/register'))
app.use(require("./index"))

app.listen(port, () => {
   console.log(`欢迎使用${port}服务器`);
})